package com.crm.business.agreement.controller;


import com.crm.business.agreement.service.IBillAgreementSealSubjectService;
import com.crm.common.agreement.entity.BO.SealSubjectBO;
import com.crm.common.agreement.entity.PO.BillAgreementSealSubject;
import com.crm.common.ka.core.common.R;
import com.crm.common.ka.core.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sealSubject")
@Api(tags = "协议签章接口")
public class BillAgreementSealSubjectController {

    @Autowired
    private IBillAgreementSealSubjectService billAgreementSealSubjectService;

    @PostMapping("/add")
    @ApiOperation("保存数据")
    public Result add(@RequestBody BillAgreementSealSubject model) {
        return R.ok(billAgreementSealSubjectService.add(model));
    }

    @PostMapping("/queryPageList")
    @ApiOperation("分页数据")
    public Result queryPageList(@RequestBody SealSubjectBO model) {
        return R.ok(billAgreementSealSubjectService.queryPageList(model));
    }

    @PostMapping("/queryList")
    @ApiOperation("全量数据")
    public Result queryList(@RequestBody SealSubjectBO model) {
        return R.ok(billAgreementSealSubjectService.queryList(model));
    }

    @GetMapping("/getSeal")
    @ApiOperation("印章图片地址")
    public Result add(@RequestParam("id") Long id) {
        return R.ok(billAgreementSealSubjectService.getSeal(id));
    }

}
